<?php
session_start();
if (isset($_SESSION['msgAlert'])){
    $msgAlert = $_SESSION['msgAlert'];
    unset($_SESSION['msgAlert']);
?>
    <script>
        window.parent.document.location.reload();
    </script>     

<?php
}

$articuloId = "";
$articuloNombre = "";
$cantidad = 0;
$costo = 0;
$obs = "";
if (array_key_exists('lineaId', $_REQUEST)) {
    $lineaId = $_REQUEST["lineaId"];
}else{
    $lineaId = "";
}    
?>
 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<link href="../css/jquery/jquery-ui-1.8.6/css/smoothness/jquery-ui-1.8.6.custom.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/main.js"></script>
<script type="text/javascript" src="../js/jquery/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="../js/jquery/jquery-ui-1.8.6/js/jquery-ui-1.8.6.custom.min.js"></script>
<script type="text/javascript" src="../js/jquery/jquery.blockUI.js"></script>
<script type="text/javascript" src="../js/jquery/jquery.form.js"></script>
<script src="../js/jquery/jquery.alerts.js" type="text/javascript"></script>
<link href="../css/jquery/jquery.alerts.css" rel="stylesheet" type="text/css" media="screen" /> 

<style>
    #moduleSectionDetalleAddList {
        margin:5 auto;
        //background:#FFF;
        z-index:20;
        top :10px;
        padding:10px 10px 10px;
        position:absolute;
    }

</style>

<script>
    function addDetalle(id){	
        window.parent.document.getElementById('moduleSectionDetalleAddList').style.display='block';
        div = window.parent.document.getElementById('moduleSectionDetalleAddList');
        var codigo=document.frmSrch.articuloId.value;
        var nombre=document.frmSrch.articuloNombre.value;
        var editOpt = "edit";
        $.post("?do=Articulo&accion=listarArticulo&modoBusqueda=1", { codigo: codigo , edit : editOpt, nombre : nombre}, function(data){
        $("#moduleSectionDetalleAddList").html(data);
        });			
    }
</script>

<body>

 <!--<div id="moduleSectionDetalleAddList"> </div>    -->
    
<div id="main2">


<div id="module">
	<h4>:: Ingreso de Mercadería - Linea</h4>
    <div id="linea">
     <form name="frmSrch" id="frmSrch" action="index.php?do=StockIngreso&accion=registrarIngresoLinea" method="post">
     <INPUT TYPE="hidden" NAME="stockIngresoId" value="<? echo $_REQUEST["stockIngresoId"];?>">
     <INPUT TYPE="hidden" NAME="lineaId" value="<? echo $lineaId;?>">         
	<table width="100%">
		<tr>
		  <td id="labelNoWidht">Id Articulo</td>
                  <td id="labelNoWidht">Nombre Articulo</td>
                  <td id="labelNoWidht">Cantidad</td>
                  <td id="labelNoWidht">Costo</td>
                </tr>
                <tr>
		  <td>
                    <input name="articuloId" type="text" id="articuloId" value="<? echo $articuloId?>" size="7"/>
                  </td>
                  <td>
		    <input name="articuloNombre" type="text" id="articuloNombre" value="<? echo $articuloNombre?>" size="40" maxlength="40"/>
                    <A HREF="javascript:addDetalle('1234')">Buscar</A>
                  </td>
		  <td><input name="cantidad" type="text" id="cantidad" value="<? echo $cantidad?>" size="7"/></td>
		  <td><input name="costo" type="text" id="costo" value="<? echo $costo?>" size="7"/>
		</tr>
                <!--
		<tr>
		  <td id="labelNoWidht">Observaciones</td>
		  <td colspan="5"><input name="obs" type="text" id="obs" value="<? echo $obs?>" size="50"/></td>
		</tr>            
                -->
		<tr>
		  <td colspan="4"></td>
		  <td><input type="submit" value="Guardar" name="aceptar2"/></td>
	    </tr>
     </table>
     </form>
    
  </div>
	
    <script>
        var params= {target:'#main2'}; 
        $('#frmSrch').ajaxForm(params); 
    </script>


</body>
</html>
